import { AdManager } from "../ads/AdManager";
import { BUNDLE_TYPE_ENUM, EVENT_NAME_ENUM } from "../base/EnumIndex";
import { AudioManager1 } from "../manager/AudioManager1";
import { EventManager } from "../manager/EventManager";
import { GameManager } from "../manager/GameManager";
import { UIManager } from "../manager/UIManager";

const { ccclass, property } = cc._decorator;

@ccclass
export default class PauseUI extends cc.Component {

    onLoad() {
        EventManager.ins.emit(EVENT_NAME_ENUM.PAUSE_TIME);
        AudioManager1.stopAllAudio();
        AdManager.naoLiReportVideo(1, "跳过本关");
    }

    clickBtnClose() {
        AudioManager1.playClick();
        UIManager.ins.close();
        EventManager.ins.emit(EVENT_NAME_ENUM.RESUME_TIME);
    }
    /** 返回主页 */
    clickBtnHome() {
        AudioManager1.playClick();
        UIManager.ins.closeAll();
        UIManager.ins.showUI("LevelUI", BUNDLE_TYPE_ENUM.HOME);
    }
    /** 跳过本关 */
    clickBtnPass() {
        AudioManager1.playClick();
        GameManager.ins.passLevel();
    }
}